From e3141794b95e534656427fadf0354435c62254d6 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Thu, 10 Apr 2025 21:42:41 +0200 Subject: Fix formatting --- src/pages/blog/[id].astro | 85 +++++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 40 deletions(-) (limited to 'src/pages/blog/[id].astro') diff --git a/src/pages/blog/[id].astro b/src/pages/blog/[id].astro index e1b5250..65c8a25 100644 --- a/src/pages/blog/[id].astro +++ b/src/pages/blog/[id].astro @@ -4,59 +4,64 @@ import { getCollection, render } from "astro:content"; import { type GetStaticPaths } from "astro"; interface Props { - entry: any; + entry: any; } -export const getStaticPaths: GetStaticPaths = (async () => { - const entries = await getCollection("blog"); - return entries.map((entry: any) => ({ - params: { id: entry.id }, - props: { entry }, - })); -}); +export const getStaticPaths: GetStaticPaths = async () => { + const entries = await getCollection("blog"); + return entries.map((entry: any) => ({ + params: { id: entry.id }, + props: { entry }, + })); +}; const { entry } = Astro.props; const { Content } = await render(entry); const formattedDate = new Date(entry.data.publishedAt).toLocaleDateString( - "es-ES", - { - year: "numeric", - month: "long", - day: "numeric", - weekday: "long", - }, + "es-ES", + { + year: "numeric", + month: "long", + day: "numeric", + weekday: "long", + }, ); const schema = { - "@context": "https://schema.org", - "@type": "BlogPosting", - headline: entry.data.title, - datePublished: entry.data.publishedAt.toISOString(), - author: { - "@type": "Person", - name: "Ariel Costas Guerrero", - }, - publisher: { - "@type": "Person", - name: "Ariel Costas Guerrero", - logo: { - "@type": "ImageObject", - url: "https://www.costas.dev/favicon.png", - }, - }, + "@context": "https://schema.org", + "@type": "BlogPosting", + headline: entry.data.title, + datePublished: entry.data.publishedAt.toISOString(), + author: { + "@type": "Person", + name: "Ariel Costas Guerrero", + }, + publisher: { + "@type": "Person", + name: "Ariel Costas Guerrero", + logo: { + "@type": "ImageObject", + url: "https://www.costas.dev/favicon.png", + }, + }, }; --- - +